#ifndef DOWNLOADEDFILE_H_
#define DOWNLOADEDFILE_H_

#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include "Constants.h"

using namespace std;

class DownloadedFile {

private:
	string fileName;
	int fd;
	struct flock fl;

public:
	DownloadedFile(string fileName);
	virtual ~DownloadedFile();

	int writeData(char* data, int dataSize);
	int readData(char* buffer, int buffSize);
	int getWriteLock();
	int getReadLock();
	int unlock();
};

#endif /* DOWNLOADEDFILE_H_ */
